package cn.seaboot.admin.quartz.dao;

import cn.seaboot.admin.quartz.bean.ScheduleJob;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 * Dao
 * quartz数据t_schedule_job
 * <p>
 *
 * @author Mr.css on 2018-6-20
 */
@Repository
public interface ScheduleJobDao {
    /**
     * 增
     *
     * @param scheduleJob pojo
     * @return affected rows
     */
    int insert(ScheduleJob scheduleJob);

    /**
     * 删
     *
     * @param id ID
     * @return affected rows
     */
    int deleteById(Long id);


    /**
     * 改
     *
     * @param scheduleJob pojo
     * @return affected rows
     */
    int updateSampleById(ScheduleJob scheduleJob);

    /**
     * 修改设备状态
     *
     * @param id     ID
     * @param status 状态
     * @return affected rows
     */
    int updateJobStatus(Long id, Integer status);


    /**
     * 查
     *
     * @param id ID
     * @return pojo
     */
    ScheduleJob selectById(Long id);

    /**
     * 查
     *
     * @param jobGroup     分组
     * @param jobName      任务名
     * @param triggerGroup 触发器分组
     * @param triggerName  触发器名
     * @return affected rows
     */
    ScheduleJob selectByName(String jobGroup, String jobName,
                             String triggerGroup, String triggerName);

    /**
     * 查列表
     *
     * @param params map
     * @return listMap
     */
    List<ScheduleJob> selectList(Map<String, Object> params);
}
